feat: WASM playground with LinearMetrics text fix and layout diagnostics#8
Merged
feat: WASM playground with LinearMetrics text fix and layout diagnostics#8
Conversation
Replace minimal test page with full IDE layout: Monaco YAML/JSON editors, preview panel with tabs (Preview/Layout/Errors), toolbar with examples dropdown and export buttons, drag-and-drop for fonts/images/content, and 300ms debounced re-rendering. Fix implicit HotReload package conflict with Central Package Management.
…ont loading via ResourceLoaders, bitmap guard - Add explicit NativeFileReference for SkiaSharp WASM (workaround for empty SkiaSharpStaticLibraryPath) - Embed Inter-Regular.ttf as default font since WASM has no system fonts - Add async font preloading via IResourceLoader chain (FontManager.PreloadFontFromResourcesAsync) - Make TemplatePreprocessor.RegisterFonts async, falling back to resource loaders when File.Exists fails - MemoryResourceLoader: also match by Path.GetFileName for absolute path lookups - Guard bitmap dimensions to minimum 1px to prevent SKImage.FromBitmap returning null - Disable static asset fingerprinting for simpler dev workflow - Fix examples: use correct YAML keys (layout: not elements:, path: not src:, add fixed: both)
…nd async font loading Enable font rendering in WASM playground by embedding Inter-Regular.ttf as default font, adding async font preloading from resource loaders (MemoryResourceLoader), and fixing SkiaSharp native library linking. Disable asset fingerprinting for simpler dev workflow.
…port, examples - Per-project VFS: each example/user project has its own files, YAML, JSON - Auto-save to IndexedDB with debounce, project switching with race guard - YAML autocomplete: schema-driven property/value suggestions + VFS file paths - ZIP export/import: bundle project as ZIP, import via button or drag & drop - 6 built-in examples: Simple Text, Flex Layout, Data Binding, Image Scaling, Dynamic Receipt (with conditional rendering, QR, overlay image), NDC Receipt - Example assets loaded from example-assets/ on first seed - Security: XSS escaping in layout inspector, ZIP path traversal rejection - Reliability: readEntries batching, IDB versionchange handler, URL revoke defer - GitHub Pages CI workflow for automated deployment
…s platforms FreeType in WASM quantizes glyph advances to integers, causing text width miscalculation and overlapping elements. Setting LinearMetrics=true on SKFont uses font design table metrics (fractional) instead of hinted metrics, matching macOS CoreText behavior. Also adds bounds overlay toggle and font diagnostics to playground UI.
Add contentW, intrinsicW, shapedW, resolvedTypeface diagnostic fields to LayoutNode and playground layout JSON for text rendering debugging. Update text_styled snapshot for LinearMetrics change.
…late Add Inter-Regular.ttf to example-assets so it appears in VFS file tree. All examples now explicitly declare the font in assets list. Fix Data Binding example: add as:item to each loop for string arrays.
- Remove reflection (Assembly.GetExecutingAssembly) for AOT safety - Gate diagnostics behind LayoutDiagnostics record + EnableDiagnostics flag - Remove InternalsVisibleTo for Playground, make ResourceLoaders public - Use ConcurrentDictionary in MemoryResourceLoader for thread safety - Add 10MB resource size limit in MemoryResourceLoader - Fix silent catch in FontManager.PreloadFontFromResourcesAsync - Fix race condition with atomic AddOrUpdate in FontManager - Add min 1px bitmap guard to all Render overloads - Escape innerHTML in context menu for XSS safety - Remove leftover debug variable in LayoutEngine - Add playground link to README, wiki Home and Getting Started
…a from color picker - FontManager: deferred disposal pattern for shared typefaces, WASM guards on system font APIs, resource loader fallback for font loading - PlaygroundApi: remove all console logs, add GetLastError() for error observability, guard native property access with IsFileLoaded() - Monaco editor: custom DocumentColorProvider that strips alpha channel from hex colors (FlexRender doesn't support alpha) - AGENTS.md: document WASM playground testing with agent-browser
This reverts commit fbf1fa4.
… family resolution LoadTypefaceByFamily and LoadTypefaceVariant filtered by _fileLoadedTypefaces before calling GetTypeface, but _fileLoadedTypefaces is only populated during lazy loading via GetTypeface → LoadTypeface. Fonts registered via RegisterFont (which only populates _fontPaths) were skipped, falling back to system fonts. Fix: call GetTypeface first to trigger lazy file loading, then check _fileLoadedTypefaces to determine if the font is safe to inspect. Also adds 27 new FontManager unit/integration tests and Font-Loading.md wiki.
RoboNET
added a commit
that referenced
this pull request
Mar 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LinearMetrics = trueon SKFont eliminates FreeType integer advance quantizationTest plan
text_styledsnapshot updated for LinearMetrics change (6.36% diff)🤖 Generated with Claude Code